package com.wzh.codegen.biz.domain.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 代码生成字段DTO
 *
 * @author wzh
 * @since 2024-01-01
 */
@Data
@Schema(description = "代码生成字段DTO")
public class CodegenColumnDTO {

    @Schema(description = "字段名")
    private String columnName;

    @Schema(description = "字段类型")
    private String columnType;

    @Schema(description = "字段长度")
    private Integer columnLength;

    @Schema(description = "字段精度")
    private Integer columnScale;

    @Schema(description = "字段注释")
    private String columnComment;

    @Schema(description = "是否主键")
    private Boolean isPrimaryKey = false;

    @Schema(description = "是否自增")
    private Boolean isAutoIncrement = false;

    @Schema(description = "是否可空")
    private Boolean isNullable = true;

    @Schema(description = "默认值")
    private String defaultValue;

    @Schema(description = "Java字段名")
    private String javaFieldName;

    @Schema(description = "Java字段类型")
    private String javaFieldType;

    @Schema(description = "是否在列表中显示")
    private Boolean showInList = true;

    @Schema(description = "是否在表单中显示")
    private Boolean showInForm = true;

    @Schema(description = "是否在查询中显示")
    private Boolean showInQuery = false;

    @Schema(description = "查询方式")
    private String queryType = "=";

    @Schema(description = "表单类型")
    private String formType = "input";

    @Schema(description = "是否在更新时自动更新为当前时间")
    private Boolean onUpdateCurrentTimestamp = false;

    @Schema(description = "额外的列属性，如 'on update CURRENT_TIMESTAMP'")
    private String extra;

}
